﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace SevenInvaders.common
{
    class Shoot:Sprite
    {
        /// <summary>
        /// Quantidade de dano que o tiro causa
        /// </summary>
        int damage;

        /// <summary>
        /// Direções que o tiro pode sair
        /// </summary>
        public enum Direction { UP, DOWN, LEFT, RIGHT };
        Direction direction;

        public static List<Shoot> list = new List<Shoot>();

        public Shoot(Texture2D texture, Vector2 positionPlayer, Direction direction, Vector2 velocityPlayer)
            : base(texture)
        {
            damage = 1;

            this.direction = direction;

            this.Position = positionPlayer;

            this.Velocity += velocityPlayer;

        }

        public override void Update(GameTime gameTime)
        {
            switch (direction)
            {
                case Direction.UP:
                    this.PositionY -= this.Velocity.Y;

                    break;

                case Direction.DOWN:
                    this.PositionY += this.Velocity.Y;

                    break;

                case Direction.LEFT:
                    this.PositionX -= this.Velocity.X;
                    break;

                case Direction.RIGHT:
                    this.PositionX += this.Velocity.X;

                    break;

            }
        }

    }
}
